package com.xbongbong.pro.serviceregistration.pojo;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.xbongbong.pro.department.pojo.DepartmentUserPojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.List;

/**
 * @author 吴峰
 * @date 2021/03/03 20:43
 */
@Setter
@Getter
@ToString
public class LowCodeServiceInfoPojo implements Serializable {
    private static final long serialVersionUID = 7229496968447602839L;

    private Long id;

    private String corpid;
    /**
     * 1: 后端注册服务；2：前端注册服务
     * @see com.xbongbong.pro.enums.lowcode.ServiceRegisterTypeEnum
     */
    private Integer serviceType;
    /**
     * @see com.xbongbong.pro.enums.lowcode.ServiceTypeEnum
     */
    private Integer type;

    private String name;

    private Integer platFormService;

    private List<DepartmentUserPojo> admin;

    private List<DepartmentUserPojo> user;

    /**
     * GET/POST请求
     */
    private String requestMethod;

    /**
     * 请求头
     */
    private JSONObject requestHeader;

    /**
     * 是否由服务器代理发起请求
     */
    private Integer proxyRequest;

    private String url;

    private Integer signatureFlag;

    private String signature;

    private Integer hmacSecretFlag;

    private String hmacSecret;

    /**
     * 参数列表
     */
    private List<ParamPojo> param;

    private String memo;
    /**
     * 是否有更新权限
     */
    private boolean update;

    /**
     * 是否有删除权限
     */
    private boolean delete;

    public LowCodeServiceInfoPojo() {
    }

    public LowCodeServiceInfoPojo(Long id, String corpid, Integer type, Integer serviceType, String name, Integer platFormService, String url, Integer signatureFlag, String signature,
                                  Integer hmacSecretFlag, String hmacSecret, String requestMethod, JSONObject requestHeader, Integer proxyRequest, List<ParamPojo> param, String memo) {
        this.id = id;
        this.corpid = corpid;
        this.type = type;
        this.serviceType = serviceType;
        this.name = name;
        this.platFormService = platFormService;
        this.url = url;
        this.signatureFlag = signatureFlag;
        this.signature = signature;
        this.hmacSecretFlag = hmacSecretFlag;
        this.hmacSecret = hmacSecret;
        this.requestMethod = requestMethod;
        this.requestHeader = requestHeader;
        this.proxyRequest = proxyRequest;
        this.param = param;
        this.memo = memo;
    }
}
